Skip to content
This repository has been archived by the owner on Sep 1, 2020. It is now read-only.

Latest commit

 

History

History
15 lines (11 loc) · 562 Bytes

6.6.2 - Channel->push.md

File metadata and controls

15 lines (11 loc) · 562 Bytes

Channel->push

向通道写入数据,函数原型:

bool function Channel->push(mixed $data);
  • $data可以为任意PHP变量,当$data是非字符串类型时底层会自动进行串化
  • $data的尺寸超过8K时会启用临时文件存储数据
  • $data必须为非空变量,如空字符串、空数组、0nullfalse
  • 写入成功返回true
  • 通道的空间不足时写入失败并返回false

某些对象无法进行序列化,因此这些对象无法使用Channel进行跨进程传递,如PDO对象